<template>
    <div>
        <p>管理员首页</p>
        <!-- <el-menu
            active-text-color="#ffd04b"
            background-color="#545c64"
            class="el-menu-vertical-demo"
            :default-active="defaultActive" 
            text-color="#fff"
            @open="handleOpen"
            @close="handleClose"
            router
        >
            <el-sub-menu v-for="menu in menus" :key="menu._id" :index="menu.url">
                <template #title>
                    <el-icon>
                        <Location />
                    </el-icon>
                    <span>{{ menu.name }}</span>
                </template>
                <el-menu-item
                    v-for="child in menu.children"
                    :key="child._id"
                    :index="child.url"
                >
                    <router-link :to="child.url">{{ child.name }}</router-link>
                </el-menu-item>
            </el-sub-menu>
        </el-menu>
        <div>
            <router-view></router-view>
        </div> -->
    </div>
</template>

<script setup>
// import { ref } from 'vue'
// import { Location } from '@element-plus/icons-vue'

// // 从 localStorage 获取菜单数据并解析
// const menus = ref(JSON.parse(localStorage.getItem('permissions_list')) || []);

// // 设定默认激活的菜单项
// const defaultActive = menus.value.length > 0 ? menus.value[0].url : ''; // 或者根据需要设置

// const handleOpen = (key, keyPath) => {
//     console.log('Opened menu:', key, keyPath)
// }
// const handleClose = (key, keyPath) => {
//     console.log('Closed menu:', key, keyPath)
// }
</script>

<style scoped>
/* .el-menu {
    width: 250px;
    height: 600px;
} */
</style>
